/*
 * ADataBasePoint.java
 *
 * Created on 2006. november 16., 16:17
 */

package hu.de.ai.graphresolver;

import hu.de.ai.*;
import java.util.*;

/**
 *
 */
public class GraphDataBasePoint extends DataBasePoint {
    
    private GraphDataBasePoint parent = null;
    private int id = 0;
    private static int idGen = 0;
    
    private GraphDataBasePoint(State state) {
        super(state);
        id = idGen++;
    }
    public GraphDataBasePoint(State state, GraphDataBasePoint parent, int cost) {
        this(state);
        this.cost = cost;
        this.parent = parent;
    }
       
    private int cost = 0;
    
    public int getCost() { return cost; }
    
    public int getID() { return id; }

    public GraphDataBasePoint getParent() { return parent; }
    
    public boolean equals(Object obj) {
        return ((GraphDataBasePoint)obj).state.equals(state);
    }
    
    public int getAValue() {
        return state.getHeuristics() + cost;
    }
}
